import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

import { ApiProperty } from '@nestjs/swagger';
import { BaseEntity } from '../base.entity';

@Entity({ name: 'sys_valid_code' })
export default class SysValidCode extends BaseEntity {
  @PrimaryGeneratedColumn()
  @ApiProperty()
  id: number;

  @ApiProperty()
  @Column()
  code: string;

  @ApiProperty()
  @Column()
  status: number;

  @ApiProperty()
  @Column({ name: 'use_id', type: 'bigint' })
  useId: number;

  @ApiProperty()
  @Column()
  email: string;

  @ApiProperty()
  @Column({ name: 'expire_at' })
  expireAt: Date;
}
